package com.d0317;

public class StopSleepThread {
    public static void main(String[] args) {
        SleepTHread sleepTHread = new SleepTHread();
        System.out.println("线程启动！！！！！！！");
        sleepTHread.start();
        sleepTHread.interrupt();
    }
}

class SleepTHread extends Thread {
    boolean flag = true;

    @Override
    public void run(){
        while (flag){
            try{
                System.out.println("线程正在运行呢！！！！！！！");
                sleep(1000*60);//休眠
            }catch (InterruptedException e){
                //e.printStackTrace();
                System.out.println("线程中断了。。。");
                flag = false;
            }
        }
    }
}
